package com.elitetyc.customview.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

import com.elitetyc.customview.R;
import com.elitetyc.customview.adapter.DoubleCheckMonthAdpater;
import com.elitetyc.customview.custom.DoubleDateCheckView;
import com.elitetyc.customview.model.DayBean;

public class DatePickerActivity extends AppCompatActivity {

    private DoubleDateCheckView ddcv_date;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_date_picker);
        ddcv_date = findViewById(R.id.ddcv_date);
        ddcv_date.setOnDateCheckLister(new DoubleCheckMonthAdpater.OnDateCheckLister() {
            @Override
            public void onDateCheckedLister(DayBean startDay, DayBean stopDay) {
                StringBuilder stringBuilder = new StringBuilder();
                if (startDay!=null){
                    stringBuilder.append(startDay.toString());
                }
                if (stopDay!=null){
                    stringBuilder.append(stopDay.toString());
                }else {
                    stringBuilder.append("请选择结束时间");
                }
                Toast.makeText(DatePickerActivity.this, stringBuilder.toString(), Toast.LENGTH_LONG).show();
            }
        });

    }
}
